<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1 , user-scalable=no">
		<title>陕西陇朝盈科技有限公司</title>
		<link rel="stylesheet" href="css/bootstrap.min.css" />
		<link rel="stylesheet" href="css/index.css" />
		<link rel="stylesheet" href="css/animate.css" />
        <link rel="stylesheet" href="css/pagination.css" />
		<script src="js/jquery-1.11.3.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script type="text/javascript" src="js/jquery.pagination.js"></script>
		<!--[if lt IE 9]>
        <script src="js/html5shiv.min.js"></script>
        <script src="js/respond.min.js"></script>
        <![endif]-->
	</head>

	<body>
    <!--导航-->
		<nav class="navbar navbar-default" role="navigation">
			<div class="container">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar-collapse">
        <span class="sr-only">切换导航</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
					<a class="navbar-brand logo" href="index.html"></a>
				</div>
				<div class="collapse navbar-collapse" id="example-navbar-collapse">
					<ul class="nav navbar-nav navbar-right">
						<li>
							<a href="index.html">首页</a>
						</li>
						<li>
							<a href="service.html">服务领域</a>
						</li>
						<li class="active">
							<a href="apply_zhiwei.html">招聘信息</a>
						</li>
						<li>
							<a href="add.html">加入我们</a>
						</li>
						<li>
							<a href="contact.html">联系我们</a>
						</li>
            <li><a href="b.html">员工风采</a></li>
					</ul>
				</div>
			</div>
		</nav>
		<!--导航-->

    <div  class="contact1"><img src="images/lx2.jpg"  title="联系我们，点击放大" style="width: 100px;height: 200px;"></div>
		<div class="contact-box" style="display: none;"><div class="sc"></div></div>

		<!--home-->
		<div id="home">
			<div class="lvjing">
				<div class="row wow fadeInUp" data-wow-duration="0.5s">
					<img class="img-responsive" src="images/banner123.jpg" alt="" />
					<div class="container">
						<div class="service-title1 hidden-xs">
							<div class="title"> 招聘信息
								<p>service field</p>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--home-->
		<!--main-->
		<div id="bbs2" style="background: #fff;padding-top: 0;">
			<div class="container">
				<div class="row wow fadeInDown" data-wow-duration="1s" data-wow-delay="0.5s">
					<div class="col-md-1 col-sm-1 col-xs-1"></div>
					<div class="col-md-10 col-sm-10 col-xs-10">
						<div class="input-group" style="border: 2px solid #00B7D9 ;border-radius: 0">
							<!--<div class="input-group-btn ">-->
								<!--<button type="button" class="btn btn-default" tabindex="-1" style="border-radius: 0;padding-left: 30px;padding-right: 0;">全国</button>-->
								<!--<button type="button" class="btn btn-default-->
                        <!--dropdown-toggle" data-toggle="dropdown" tabindex="-1" style="border-left: 0">-->
                  <!--<span class="caret"></span>-->
                  <!--<span class="sr-only">切换下拉菜单</span>-->
                <!--</button>-->
							<!--</div>-->
							<!-- /btn-group -->
							<input id="position" type="text" class="form-control" value="" />
							<span class="input-group-btn">
            <button class="btn btn-default"  type="button" style="padding: 6px 30px;color:#fff;background: #00B7D9 ;border: 1px solid #00B7D9;border-radius: 0">搜索</button>
          </span>
						</div>
						<!-- /input-group -->
					</div>
				</div>
				<div class="row" style="margin-top: 10px">
					<div class="col-md-1 col-sm-1 col-xs-1"></div>
					<div class="col-md-9 col-sm-9 col-xs-9">
						<ul id="myTab" style="font-weight: 800;background: #f6f6f8">
							<li id="heat_recruit" class="active">热门职位</li>
							<li id="position_update_time" class="news">最新职位</li>
							<li id="position_salary" class="h_money">高薪职位</li>
						</ul>
						<div class="clear"></div>
						<div id="myTabContent">
							<!--<div class="tab-pane fade in active" id="home1"></div>-->
							<!--<div class="tab-pane fade" id="ios"></div>-->
							<!--<div class="tab-pane fade" id="jmeter"></div>-->
						</div>
            <div class="clear"></div>
            <!--<div id="Pagination" class="pagination">&lt;!&ndash; 这里显示分页 &ndash;&gt;</div>-->
            <div id="pageBox" style="width:100%;margin: 30px auto;"></div>
					</div>
				</div>
				<!--</div>-->
			</div>
		</div>
    <!--main-->
		<!--footer-->
    <div class="footer">
      <div class="container">
        <div class="row">
          <div class="col-md-6 col-sm-6 col-xs-12">
            <div class="row">
              <div class="col-md-4 col-sm-4 col-xs-4">
                <h4>服务热线</h4>
                <ul class="list-unstyled">
                  <li>
                    <a href="#">人力资源服务</a>
                  </li>
                  <li>
                    <a href="#">陕西社保</a>
                  </li>
                  <li>
                    <a href="#">代办代缴</a>
                  </li>
                </ul>
              </div>
              <div class="col-md-4 col-sm-4 col-xs-4">
                <h4>加入我们</h4>
                <ul class="list-unstyled">
                  <li>
                    <a href="#">期待和您一起</a>
                  </li>
                  <li>
                    <a href="#">奋进</a>
                  </li>
                </ul>
              </div>
              <div class="col-md-4 col-sm-4 col-xs-4">
                <h4>招聘社区</h4>
                <ul class="list-unstyled">
                  <li>
                    <a href="#">中粮业务代表</a>
                  </li>
                  <li>
                    <a href="#">迎聘岗位</a>
                  </li>
                </ul>
              </div>
            </div>
          </div>
          <div class="col-md-6 col-sm-6 col-sm-12">
            <div class="row">
              <div class="col-md-6 col-sm-6 col-xs-6">
                <h4>联系我们</h4>
                <ul class="list-unstyled">
                  <li>
                    <a href="#">办公地址：陕西省西安市经济开发区凤城二路海璟国际A座1801室</a>
                  </li>
                  <li>
                    <a href="#">座机：89619882</a>
                  </li>
                  <li>
                    <a href="#">电话：17782655152</a>
                  </li>
                </ul>

              </div>
              <div class="col-md-6 col-sm-6 col-xs-6">
                <ul class="list-unstyled">
                  <li>
                    <a href="#"><img style="width: 50%;height:auto;" src="images/top_03.png" alt="" /></a>
                  </li>
                </ul>
                <p>扫一扫了解更多职位</p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
		<!--footer-->
    <script>
  // tab 内容
  var value1="";
  console.log(value1);
  $("button").click(function() {
    //判断输入框内容为空的时候
    var value1=$("#position").val();
  //  var value1=encodeURIComponent(encodeURIComponent($("#position").val()));
    var i=$("#myTab li").index();
    $("#myTabContent div").hide().children(i).show();
    console.log(value1);
    if(value1 == ""||value1 == "null"||value1 == "undefined"){
      value1="";
      tab(value1);
    }else {
      tab(value1);
    }
  })
  tab();
  var i=$("#myTab li").index();
  function tab(value1){
  $.ajax({
    url:"http://www.ypinkj.com/api/position/web/getSearch?",
    data:{postValue:value1,page:1,limit:4},
    contentType :'application/json;charset=utf-8',
    dataType:'json',
    type:"GET",   //请求方式
    success: function(req) { //请求成功时处理
            if (req.code = 200) {
              var dats = req;//console.log(req);//console.log(dats);
              console.log(value1);
              var str = '';
              console.log(dats);
              if(i==0) {
                dats.data.sort(compare("heatRecruit"));
                for (var k = 0; k< dats.data.length; k++) {
                  var html = '';
                  html += "<a target='_blank' href='details.html?jobTypeId=" +i + "&positionName=" + dats.data[k].positionName + "&positionId=" + dats.data[k].positionId + "' >";
                  html += "<div class='list-group'>";
                  html += "<div class=' col-md-7 col-sm-7 col-xs-7'>";
                  html += "<h5 style='font-weight: 800;font-size: 14px'>" + dats.data[k].positionTitle + "</h5>"
                  html += "<p><span class='red' style='font-weight: 800'>" + dats.data[k].positionSalary + "</span>元/月</p>";
                  for (var j = 0; j < dats.data[k].welfareLables.length; j++) {
                    html += "<span class='wuxian'>" + dats.data[k].welfareLables[j].lableName + "</span>";
                  }
                  html += "</div>"
                  html += "<div class='col-md-4 col-sm-4 col-xs-4'>"
                  html += "<h5 style='font-weight: bold '>" + dats.data[k].companyName + "</h5>"
                  html += "<p style='font-size: 12px'>" + dats.data[k].education + "</p>"
                  html += "<span style='font-size: 12px'>" + formatDt(parseInt(dats.data[k].positionUpdateTime)) + "发布</span>"
                  html += "</div>"
                  html += "</div>";
                  html += "</a>";
                  str += html;
                }
                $("#myTabContent").append(str);
              }
              $("#myTab").on("click","li",function(){
                var str="";
                var i=$(this).index();
                // 点击某个元素时，给这个元素添加active类，其余兄弟元素的active类都取消
                $(this).addClass("active").siblings().removeClass("active");
                $("#myTabContent div").hide().children(i).show();
//              })
              if(i ==1){
                dats.data.sort(compare("positionUpdateTime"));
                  for (var k =0; k < dats.data.length ; k++) {
                  var html = '';
                  html +="<a target='_blank' href='details.html?jobTypeId=" + i + "&positionName=" +dats.data[k].positionName + "&positionId="+ dats.data[k].positionId +"' >";
                  html += "<div class='list-group'>";
                  html += "<div class=' col-md-7 col-sm-7 col-xs-7'>";
                  html += "<h5 style='font-weight: 800;font-size: 14px'>" + dats.data[k].positionTitle + "</h5>"
                  html += "<p><span class='red' style='font-weight: 800'>" + dats.data[k].positionSalary + "</span>元/月</p>";
                  for (var j = 0 ; j < dats.data[k].welfareLables.length; j++) {
                    html += "<span class='wuxian'>" + dats.data[k].welfareLables[j].lableName + "</span>";
                  }
                  html += "</div>"
                  html += "<div class='col-md-4 col-sm-4 col-xs-4'>"
                  html += "<h5 style='font-weight: bold '>" + dats.data[k].companyName + "</h5>"
                  html += "<p style='font-size: 12px'>" + dats.data[k].education + "</p>"
                  html += "<span style='font-size: 12px'>" + formatDt(parseInt(dats.data[k].positionUpdateTime)) + "发布</span>"
                  html += "</div>"
                  html += "</div>";
                  html +="</a>";
                  str  += html;
                }
              }else if(i==2){
                dats.data.sort(compare("positionSalary"));
                for (var k = 0 ; k <= dats.data.length-1 ; k ++) {
                  var html = '';
                  html +="<a target='_blank' href='details.html?jobTypeId=" + i + "&positionName=" +dats.data[k].positionName + "&positionId="+ dats.data[k].positionId +"' >";
                  html += "<div class='list-group'>";
                  html += "<div class=' col-md-7 col-sm-7 col-xs-7'>";
                  html += "<h5 style='font-weight: 800;font-size: 14px'>" + dats.data[k].positionTitle + "</h5>"
                  html += "<p><span class='red' style='font-weight: 800'>" + dats.data[k].positionSalary + "</span>元/月</p>";
                  for (var j = 0 ; j < dats.data[k].welfareLables.length; j++) {
                    html += "<span class='wuxian'>" + dats.data[k].welfareLables[j].lableName + "</span>";
                  }
                  html += "</div>"
                  html += "<div class='col-md-4 col-sm-4 col-xs-4'>"
                  html += "<h5 style='font-weight: bold '>" + dats.data[k].companyName + "</h5>"
                  html += "<p style='font-size: 12px'>" + dats.data[k].education + "</p>"
                  html += "<span style='font-size: 12px'>" + formatDt(parseInt(dats.data[k].positionUpdateTime)) + "发布</span>"
                  html += "</div>"
                  html += "</div>";
                  html +="</a>";
                  str  += html;
                }
              }else{
//                if(i==0) {
                  dats.data.sort(compare("heatRecruit"));
                  for (var k = 0; k< dats.data.length; k++) {
                    var html = '';
                    html += "<a target='_blank' href='details.html?jobTypeId=" +i + "&positionName=" + dats.data[k].positionName + "&positionId=" + dats.data[k].positionId + "' >";
                    html += "<div class='list-group'>";
                    html += "<div class=' col-md-7 col-sm-7 col-xs-7'>";
                    html += "<h5 style='font-weight: 800;font-size: 14px'>" + dats.data[k].positionTitle + "</h5>"
                    html += "<p><span class='red' style='font-weight: 800'>" + dats.data[k].positionSalary + "</span>元/月</p>";
                    for (var j = 0; j < dats.data[k].welfareLables.length; j++) {
                      html += "<span class='wuxian'>" + dats.data[k].welfareLables[j].lableName + "</span>";
                    }
                    html += "</div>"
                    html += "<div class='col-md-4 col-sm-4 col-xs-4'>"
                    html += "<h5 style='font-weight: bold '>" + dats.data[k].companyName + "</h5>"
                    html += "<p style='font-size: 12px'>" + dats.data[k].education + "</p>"
                    html += "<span style='font-size: 12px'>" + formatDt(parseInt(dats.data[k].positionUpdateTime)) + "发布</span>"
                    html += "</div>"
                    html += "</div>";
                    html += "</a>";
                    str += html;
                  }
              }
              $("#myTabContent").append(str);
              })
//              console.log(str);
            }
          },error:function(){
      //请求出错处理
    }
  });
}
  function compare(heatRecruit) {
    return function(object1, object2) {
      var value1 = object1[heatRecruit];
      var value2 = object2[heatRecruit];
      if (value2 >value1) {
        return 1;
      } else if (value2 < value1) {
        return -1;
      } else {
        return 0;
      }
    }
  }

  function formatDt(data){
    var date = new Date(data);
    //定义数组week: 包含日,一,二,....,六
    //var week=
    //["日","一","二","三","四","五","六"];
    //获得date中的年保存在y中
    var y=date.getFullYear();
    //获得date中的月+1后保存在M中
    var M=date.getMonth()+1;
    M<10&&(M="0"+M);//如果M<10，改为0+M
    //获得date中的日保存在d中
    var d=date.getDate();
    d<10&&(d="0"+d);//如果d<10，改为0+d
    //获得date中的星期保存在day中
    var day=date.getDay();
    //获取week中day位置的汉字保存回day中
//    day=week[day];
    //获得date中的小时保存在h中
    var h=date.getHours();
    //声明变量am，如果h<12，am就赋值为上午,否则赋值为下午
    //var am=h<12?"上午":"下午";
    //h>12&&(h-=12);//如果h>12,就h-12
    //h<10&&(h="0"+h);//如果h<10,就改为0+h
    ////获得date中的分钟保存在m中
    var m=date.getMinutes();
    //m<10&&(m="0"+m);//如果m<10,就改为0+m
    //获得date中的秒保存在s中
    var s= date.getSeconds();
    return y+"-"+M+"-"+d+" " +h+":"+m+":"+s;
    //" 星期"+day +" " +am

  }



function pageList(){
var total = 500,//数据总条数
  pageNumber = 1,//当前页
  pageSize = 10, //每页显示的条数
  edges = 2,//两侧显示的页码数 大于1
  playes = 5,//主页码区显示的页码数 大于3
  pages = Math.ceil(total / pageSize);//总页数
renderPageItem();
function renderPageItem() {
  $ul = $('<ul class="pagination"></ul>');
  var start = 1;
  var end = pages;
  if (playes % 2) {
    //playes是奇数
    start = pageNumber - Math.floor(playes / 2);
    end = pageNumber + Math.floor(playes / 2);
  } else {
    //playes是偶数
    start = pageNumber - (playes / 2 - 1);
    end = pageNumber + playes / 2;
  }

  if (start <= edges + 1) {
    start = 1;
    if (end < playes && playes<pages) {
      end = playes;
    }
  } else {
    for (var i = 1; i <= edges; i++) {
      $ul.append(renderItem(i));
    }
    $ul.append('<li><span>...</span></li>')
  }
  if (end < pages - edges) {
    for (var i = start; i <= end; i++) {
      $ul.append(renderItem(i));
    }
    $ul.append('<li><span>...</span></li>');
    for (var i = pages - edges + 1; i <= pages; i++) {
      $ul.append(renderItem(i));
    }
  } else {
    end = pages;
    if(start>pages-playes+1){
      start = pages-playes+1
    }
    for (var i = start; i <= end; i++) {
      $ul.append(renderItem(i));
    }
  }
  $ul.prepend(renderPrevItem());
  $ul.append(renderNextItem());
  $('#pageBox').empty().append($ul);
}

function renderItem(i) {
  $item = $('<li><a href="#">' + i + '</a></li>');
  if (i == pageNumber) {
    $item.addClass('active');
  }
  $item.on('click', (function (num) {
    return function () {
      pageNumber = num;
      renderPageItem();
    }
  })(i));
  return $item
}

function renderPrevItem() {
  $prev = $('<li><a href="#">&laquo;</a></li>');
  if (pageNumber == 1) {
    $prev.addClass('disabled');
  } else {
    $prev.on('click', function () {
      pageNumber = pageNumber - 1;
      renderPageItem();
    })
  }
  return $prev;
}

function renderNextItem() {
  $next = $('<li><a href="#">&raquo;</a></li>');
  if (pageNumber == pages) {
    $next.addClass('disabled');
  } else {
    $next.on('click', function () {
      pageNumber = pageNumber + 1;
      renderPageItem();
    })
  }
  return $next;
}
}

    </script>
    <script>
      $('.contact1').click(function(){$('.contact-box').show()});
      $('.sc').click(function(){$('.contact-box').hide();});
      $('.contact-box').click(function(){  $('.contact-box').hide();});
      </script>
	</body>

</html>
